package com.jlstu.designmodedemo.controller;

import com.jlstu.designmodedemo.abstracthandler.AbstractColaHandler;
import com.jlstu.designmodedemo.factory.ColaFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @GetMapping("/test1") // http://localhost:8080/test1?type=Wahaha
    public String test(String type) {
        AbstractColaHandler handler = ColaFactory.getInvokeStrategy(type);
        return handler.invokeCommon();
    }
}
